package cn.java63.biz;

import org.aspectj.lang.ProceedingJoinPoint;

public class UserServiceLogger {
    public Object lanjie(ProceedingJoinPoint jp) throws Throwable{
        if(jp.getSignature().getName().equals("del")){
            long id=(long)jp.getArgs()[0];
            if(id==1){
                throw new Exception("不能删除");
            }
        }
        long start=System.nanoTime();
        Object o=jp.proceed();//放行
        long end=System.nanoTime();
        System.out.println("执行时间"+(end-start)+"返回值"+o);
        return o;
    }
}
